package com.yzq.authorization.server.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: yangjie.deng@resico.cn
 * @since: 2024-01-29 11:01:44
 * @version: v1.0.0
 * @describe:
 */
@RestController
@RequestMapping("api")
public class TestController {

    @GetMapping("greeting")
    @PreAuthorize(value = "hasAuthority('app')")
    public String greeting() {
        return "Hello, Authorization Server.";
    }

    @GetMapping("/test02")
    @PreAuthorize("hasAuthority('SCOPE_message.write')")
    public String test02() {
        return "test02";
    }

}
